package day5;

import java.util.Arrays;

public class Add {
    public static void main(String[] args) {
        int nums1[]={1,2,3,4,5};
        int nums2[]={10,9,8,7,6};
        int newNums[]=new int[nums1.length+nums2.length];
        for (int i=0;i<nums1.length;i++){
            newNums[i]=nums1[i];
        }
        for (int j=0;j<nums2.length;j++){
            newNums[j+nums1.length]=nums2[j];
        }
        System.out.println("合并前："+Arrays.toString(newNums));
        Arrays.sort(newNums);
        System.out.println("排序后的数组为："+ Arrays.toString(newNums));
    }
}
